package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.OrderDO;
import com.ssy.lingxi.order.entity.OrderInvoiceDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 订单发票信息Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
@Repository
public interface OrderInvoiceRepository extends JpaRepository<OrderInvoiceDO, Long>, JpaSpecificationExecutor<OrderInvoiceDO> {
    OrderInvoiceDO findFirstByOrder(OrderDO order);

    @Transactional
    void deleteByOrder(OrderDO order);
}
